package com.xjgc.controller;

import com.xjgc.rest.ao.MsiRealAO;
import com.xjgc.server.MsiRealHandle;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author: 小逗号
 * @date: 2023-11-27
 * @description:
 * @since:
 */
@Slf4j
@Api(tags = "实时财务")
@RestController
@RequestMapping("/real/sap/finance")
public class RealSapFinanceController {
    private static final String SERVER_CODE = "RealTaskFinance";

    @Resource
    private MsiRealHandle msiRealHandle;

/*    @ApiOperation("通用实时接口")
    @PostMapping("/realPost")
    public Result<?> realPost(@RequestBody MsiRealAO ao) {
        Result<?> result = msiRealHandle.handle(ao.getServerCode(), ao.getTaskCode(), ao.getParams());
        return result;
    }*/


    @ApiOperation("预制发票")
    @PostMapping("/zxM2sMir7")
    public Result<?> zxM2sMir7(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "zxM2sMir7", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }

    @ApiOperation("发送付款申请")
    @PostMapping("/fsFksq")
    public Result<?> fsFksq(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "fsFksq", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }

    @ApiOperation("发送制证申请")
    @PostMapping("/fsZzsq")
    public Result<?> fsZzsq(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "fsZzsq", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }


    @ApiOperation("预算控制方案执行数检查")
    @PostMapping("/budgetCtlCheck")
    public Result<?> budgetCtlCheck(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "budgetCtlCheck", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }

    @ApiOperation("回写预算执行数")
    @PostMapping("/budgetWrite")
    public Result<?> budgetWrite(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "budgetWrite", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }

    @ApiOperation("预算执行数释放")
    @PostMapping("/budgetCancle")
    public Result<?> budgetCancle(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "budgetCancle", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }

    @ApiOperation("供应商收款账号明细")
    @PostMapping("/wlZfibc33")
    public Result<?> wlZfibc33(@RequestBody Map<String, Object> param) {
        MsiRealAO msiRealAO = new MsiRealAO(SERVER_CODE, "wlZfibc33", param);
        Result<?> result = msiRealHandle.handle(msiRealAO);
        return result;
    }


}
